package com.example.applications.Kotlin

fun main() {

    //不可变list
    val list = listOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)

    println("第一个元素为" + list[0])

    println("遍历所有元素:" + list.forEach { println(-it) })

    //可变list
    val list1 = mutableListOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
    list1.add(11)
    println("第一个元素为" + list1[0])
    println("遍历所有元素:" + list1.forEach { println(-it) })

    val list2 = setOf(1, 1, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10)
    println(list2)

}